<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qtsoap-2.6-opensource/src/qtsoap.cpp -->
<head>
  <title>QtSoapStruct Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
</tr></table><h1 class="title">QtSoapStruct Class Reference</h1>
<p>The QtSoapStruct class is an implementation of the SOAP struct type. <a href="#details">More...</a></p>
<pre> #include &lt;QtSoapStruct&gt;</pre><p>Inherits <a href="qtsoaptype.html">QtSoapType</a>.</p>
<ul>
<li><a href="qtsoapstruct-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qtsoapstruct.html#QtSoapStruct">QtSoapStruct</a></b> ()</li>
<li><div class="fn"/><b><a href="qtsoapstruct.html#QtSoapStruct-2">QtSoapStruct</a></b> ( const QtSoapQName &amp; <i>name</i> )</li>
<li><div class="fn"/><b><a href="qtsoapstruct.html#QtSoapStruct-3">QtSoapStruct</a></b> ( const QtSoapStruct &amp; <i>copy</i> )</li>
<li><div class="fn"/><b><a href="qtsoapstruct.html#dtor.QtSoapStruct">~QtSoapStruct</a></b> ()</li>
<li><div class="fn"/>QtSoapType &amp; <b><a href="qtsoapstruct.html#at">at</a></b> ( const QtSoapQName &amp; <i>key</i> )</li>
<li><div class="fn"/>const QtSoapType &amp; <b><a href="qtsoapstruct.html#at-2">at</a></b> ( const QtSoapQName &amp; <i>key</i> ) const</li>
<li><div class="fn"/>virtual void <b><a href="qtsoapstruct.html#clear">clear</a></b> ()</li>
<li><div class="fn"/>virtual int <b><a href="qtsoapstruct.html#count">count</a></b> () const</li>
<li><div class="fn"/>void <b><a href="qtsoapstruct.html#insert">insert</a></b> ( QtSoapType * <i>item</i> )</li>
<li><div class="fn"/>virtual bool <b><a href="qtsoapstruct.html#parse">parse</a></b> ( QDomNode <i>node</i> )</li>
<li><div class="fn"/>virtual QDomElement <b><a href="qtsoapstruct.html#toDomElement">toDomElement</a></b> ( QDomDocument <i>doc</i> ) const</li>
<li><div class="fn"/>QtSoapStruct &amp; <b><a href="qtsoapstruct.html#operator-eq">operator=</a></b> ( const QtSoapStruct &amp; <i>copy</i> )</li>
<li><div class="fn"/>virtual QtSoapType &amp; <b><a href="qtsoapstruct.html#operator-5b-5d">operator[]</a></b> ( const QtSoapQName &amp; <i>key</i> )</li>
<li><div class="fn"/>virtual const QtSoapType &amp; <b><a href="qtsoapstruct.html#operator-5b-5d-2">operator[]</a></b> ( const QtSoapQName &amp; <i>key</i> ) const</li>
<li><div class="fn"/>virtual QtSoapType &amp; <b><a href="qtsoapstruct.html#operator-5b-5d-3">operator[]</a></b> ( const QString &amp; <i>key</i> )</li>
<li><div class="fn"/>virtual const QtSoapType &amp; <b><a href="qtsoapstruct.html#operator-5b-5d-4">operator[]</a></b> ( const QString &amp; <i>key</i> ) const</li>
<li><div class="fn"/>virtual QtSoapType &amp; <b><a href="qtsoapstruct.html#operator-5b-5d-5">operator[]</a></b> ( int <i>i</i> )</li>
<li><div class="fn"/>virtual const QtSoapType &amp; <b><a href="qtsoapstruct.html#operator-5b-5d-6">operator[]</a></b> ( int <i>i</i> ) const</li>
</ul>
<ul>
<li><div class="fn"/>25 public functions inherited from <a href="qtsoaptype.html#public-functions">QtSoapType</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>2 static public members inherited from <a href="qtsoaptype.html#static-public-members">QtSoapType</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QtSoapStruct class is an implementation of the SOAP struct type.</p>
<p>A SOAP struct is a dictionary of QtSoapTypes where entries are looked up by name. Entries in a struct can be of any <a href="qtsoaptype.html">QtSoapType</a> type, such as <a href="qtsoaparray.html">QtSoapArray</a>, QtSoapStruct or <a href="qtsoapsimpletype.html">QtSoapSimpleType</a>.</p>
<p>The struct can be created in several ways. <a href="qtsoapstruct.html#parse">parse</a>() generates a struct by analyzing a <a href="http://doc.trolltech.com/4.4/qdomnode.html">QDomNode</a>. <a href="qtsoapstruct.html#insert">insert</a>() is used to add items manually.</p>
<pre> QtSoapStruct myStruct(QtSoapQName(&quot;myStruct&quot;));

 myStruct.insert(new QtSoapSimpleType(QtSoapQName(&quot;item1&quot;), 5));
 myStruct.insert(new QtSoapSimpleType(QtSoapQName(&quot;item2&quot;), &quot;hello&quot;));
 myStruct.insert(new QtSoapSimpleType(QtSoapQName(&quot;item3&quot;), true));</pre>
<p>Use the operator[]() or <a href="qtsoapstruct.html#at">at</a>() when looking up entries in a struct by name. If the names are unknown, <a href="qtsoapstructiterator.html">QtSoapStructIterator</a> lets you iterate through all the items.</p>
<pre> QtSoapType &amp;helloItem = myStruct[&quot;Hello&quot;];</pre>
<p><a href="qtsoapstruct.html#toDomElement">toDomElement</a>() converts the QtSoapStruct to a DomElement.</p>
<p>See also <a href="qtsoapstructiterator.html">QtSoapStructIterator</a>, <a href="qtsoaptype.html">QtSoapType</a>, <a href="qtsoaparray.html">QtSoapArray</a>, and <a href="qtsoapsimpletype.html">QtSoapSimpleType</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QtSoapStruct"></a>QtSoapStruct::QtSoapStruct ()</h3>
<p>Constructs an empty <a href="qtsoapstruct.html">QtSoapStruct</a>.</p>
<h3 class="fn"><a name="QtSoapStruct-2"></a>QtSoapStruct::QtSoapStruct ( const <a href="qtsoapqname.html">QtSoapQName</a> &amp; <i>name</i> )</h3>
<p>Constructs an empty <a href="qtsoapstruct.html">QtSoapStruct</a> and sets its <a href="qtsoaptype.html#Type-enum">QName</a> (qualified name) to <i>name</i>.</p>
<h3 class="fn"><a name="QtSoapStruct-3"></a>QtSoapStruct::QtSoapStruct ( const QtSoapStruct &amp; <i>copy</i> )</h3>
<p>Constructs a <a href="qtsoapstruct.html">QtSoapStruct</a> that is a copy of <i>copy</i>.</p>
<h3 class="fn"><a name="dtor.QtSoapStruct"></a>QtSoapStruct::~QtSoapStruct ()</h3>
<p>Destructs the <a href="qtsoapstruct.html">QtSoapStruct</a>.</p>
<h3 class="fn"><a name="at"></a><a href="qtsoaptype.html">QtSoapType</a> &amp; QtSoapStruct::at ( const <a href="qtsoapqname.html">QtSoapQName</a> &amp; <i>key</i> )</h3>
<p>Returns a reference to the item in this struct whose <a href="qtsoaptype.html#Type-enum">QName</a> (qualified name) is <i>key</i>. If no such item exists, an empty <a href="qtsoaptype.html">QtSoapType</a> is returned.</p>
<h3 class="fn"><a name="at-2"></a>const <a href="qtsoaptype.html">QtSoapType</a> &amp; QtSoapStruct::at ( const <a href="qtsoapqname.html">QtSoapQName</a> &amp; <i>key</i> ) const</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns a reference to the item in this struct whose <a href="qtsoaptype.html#Type-enum">QName</a> (qualified name) is <i>key</i>. If no such item exists, an empty <a href="qtsoaptype.html">QtSoapType</a> is returned.</p>
<h3 class="fn"><a name="clear"></a>void QtSoapStruct::clear ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Removes all items from the struct.</p>
<p>Reimplemented from <a href="qtsoaptype.html#clear">QtSoapType</a>.</p>
<h3 class="fn"><a name="count"></a>int QtSoapStruct::count () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the number of items in this struct.</p>
<p>Reimplemented from <a href="qtsoaptype.html#count">QtSoapType</a>.</p>
<h3 class="fn"><a name="insert"></a>void QtSoapStruct::insert ( <a href="qtsoaptype.html">QtSoapType</a> * <i>item</i> )</h3>
<p>Inserts the <a href="qtsoaptype.html">QtSoapType</a> <i>item</i> into this struct. Any existing item with the same <a href="qtsoaptype.html#Type-enum">QName</a> (qualified name) will be erased.</p>
<h3 class="fn"><a name="parse"></a>bool QtSoapStruct::parse ( <a href="http://doc.trolltech.com/4.4/qdomnode.html">QDomNode</a> <i>node</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Inspects <i>node</i> and constructs the equivalent <a href="qtsoapstruct.html">QtSoapStruct</a> if <i>node</i> qualifies as a SOAP struct. Returns true if it does; otherwise returns false.</p>
<p>Reimplemented from <a href="qtsoaptype.html#parse">QtSoapType</a>.</p>
<h3 class="fn"><a name="toDomElement"></a><a href="http://doc.trolltech.com/4.4/qdomelement.html">QDomElement</a> QtSoapStruct::toDomElement ( <a href="http://doc.trolltech.com/4.4/qdomdocument.html">QDomDocument</a> <i>doc</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Generates the <a href="http://doc.trolltech.com/4.4/qdomelement.html">QDomElement</a> representation of this struct. The returned <a href="http://doc.trolltech.com/4.4/qdomelement.html">QDomElement</a> is created using <i>doc</i>.</p>
<p>Reimplemented from <a href="qtsoaptype.html#toDomElement">QtSoapType</a>.</p>
<h3 class="fn"><a name="operator-eq"></a>QtSoapStruct &amp; QtSoapStruct::operator= ( const QtSoapStruct &amp; <i>copy</i> )</h3>
<p>Makes this struct a copy of <i>copy</i>.</p>
<h3 class="fn"><a name="operator-5b-5d"></a><a href="qtsoaptype.html">QtSoapType</a> &amp; QtSoapStruct::operator[] ( const <a href="qtsoapqname.html">QtSoapQName</a> &amp; <i>key</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns a reference to the item in this struct whose <a href="qtsoaptype.html#Type-enum">QName</a> (qualified name) is <i>key</i>. If no such item exists, an empty <a href="qtsoaptype.html">QtSoapType</a> is returned.</p>
<p>Reimplemented from <a href="qtsoaptype.html#operator-5b-5d-2">QtSoapType</a>.</p>
<h3 class="fn"><a name="operator-5b-5d-2"></a>const <a href="qtsoaptype.html">QtSoapType</a> &amp; QtSoapStruct::operator[] ( const <a href="qtsoapqname.html">QtSoapQName</a> &amp; <i>key</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns a reference to the item in this struct whose <a href="qtsoaptype.html#Type-enum">QName</a> (qualified name) is <i>key</i>. If no such item exists, an empty <a href="qtsoaptype.html">QtSoapType</a> is returned.</p>
<p>Reimplemented from <a href="qtsoaptype.html#operator-5b-5d-5">QtSoapType</a>.</p>
<h3 class="fn"><a name="operator-5b-5d-3"></a><a href="qtsoaptype.html">QtSoapType</a> &amp; QtSoapStruct::operator[] ( const <a href="http://doc.trolltech.com/4.4/qstring.html">QString</a> &amp; <i>key</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns a reference to the item in this struct whose <a href="qtsoaptype.html#Type-enum">QName</a> (qualified name) is <i>key</i>. If no such item exists, an empty <a href="qtsoaptype.html">QtSoapType</a> is returned.</p>
<p>Reimplemented from <a href="qtsoaptype.html#operator-5b-5d-3">QtSoapType</a>.</p>
<h3 class="fn"><a name="operator-5b-5d-4"></a>const <a href="qtsoaptype.html">QtSoapType</a> &amp; QtSoapStruct::operator[] ( const <a href="http://doc.trolltech.com/4.4/qstring.html">QString</a> &amp; <i>key</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns a reference to the item in this struct whose <a href="qtsoaptype.html#Type-enum">QName</a> (qualified name) is <i>key</i>. If no such item exists, an empty <a href="qtsoaptype.html">QtSoapType</a> is returned.</p>
<p>Reimplemented from <a href="qtsoaptype.html#operator-5b-5d-6">QtSoapType</a>.</p>
<h3 class="fn"><a name="operator-5b-5d-5"></a><a href="qtsoaptype.html">QtSoapType</a> &amp; QtSoapStruct::operator[] ( int <i>i</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns a reference to item number <i>i</i> in this struct. If no such item exists, an empty <a href="qtsoaptype.html">QtSoapType</a> is returned.</p>
<p>The items are ordered in the sequence in which they were inserted, starting from 0.</p>
<p>Reimplemented from <a href="qtsoaptype.html#operator-5b-5d">QtSoapType</a>.</p>
<h3 class="fn"><a name="operator-5b-5d-6"></a>const <a href="qtsoaptype.html">QtSoapType</a> &amp; QtSoapStruct::operator[] ( int <i>i</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns a reference to item number <i>i</i> in this struct. If no such item exists, an empty <a href="qtsoaptype.html">QtSoapType</a> is returned.</p>
<p>The items are ordered in the sequence in which they were inserted, starting from 0.</p>
<p>Reimplemented from <a href="qtsoaptype.html#operator-5b-5d-4">QtSoapType</a>.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%" align="left">Copyright &copy; 2009 Nokia</td>
<td width="40%" align="center"><a href="http://doc.trolltech.com/trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
</tr></table></div></address></body>
</html>
